<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>密码修改</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="decorator" content="ems_${site.theme}_front" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="${site.description}" />
<meta name="keywords" content="${site.keywords}" />
<link rel="stylesheet" href="${ctxStatic}/sdsng/lib/weui.min.css">
<link rel="stylesheet" href="${ctxStatic}/sdsng/css/jquery-weui.css">
<link rel="stylesheet" href="${ctxStatic}/sdsng/css/style.css">
</head>
<body ontouchstart>
<!--顶部搜索-->
<!--主体-->
<header class="">

</header>
<div class="wy-content">
  <div class="category-top">
    <header class='wy-header'>
    <div class="wy-header-icon-back"><span></span></div>
	  <div class="wy-header-title" style="text-align:left">课程类别
	  <select class="selectstyle" id="termId">
	  		<!-- <option>春节学期</option> -->
	  		<c:forEach items="${emsTermList }" var="term">
	  			<option value="${term.id }" ${emsTerm.id eq term.id?'selected':''}>${term.name }</option>
	  		</c:forEach>
	  </select>
	  <select  class="selectstyle" id="areaId" onchange="selectMajor();">
	  		<!-- <option>中心校区</option> -->
	  		<c:forEach items="${emsAreaList }" var="area">
	  			<option value="${area.id }" ${emsArea.id eq area.id?'selected':''}>${area.name }</option>
	  		</c:forEach>
	  </select>
	  </div>
	</header>
 
  </div> 
  
  <aside>
    <div class="menu-left scrollbar-none" id="sidebar">
      <ul>
        <!-- <li class="active">文体部</li>
        <li>音乐部</li> -->
        
        <c:forEach items="${emsDetpsList }" var="dept" varStatus="stat">
        	<c:if test="${stat.index eq 0}">
        		<li class="active" deptId="${dept.id }" onclick="selectDept(this);">${dept.name }</li>
        	</c:if>
        	<c:if test="${stat.index gt 0}">
  				<li deptId="${dept.id }" onclick="selectDept(this);">${dept.name }</li>
  			</c:if>
  		</c:forEach>
       
      </ul>
      <input type="hidden" id="deptId" value="${fn:length(emsDetpsList) gt 0 ? emsDetpsList[0].id : ''}">
    </div>
  </aside>
  
  <%-- <section class="menu-right padding-all j-content">
    <h5><center>文体部</center></h5>
    <ul>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/jingxuan1.jpg"><span>专业名称</span></li>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/jingxuan1.jpg"><span>专业名称</span></li>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/jingxuan1.jpg"><span>专业名称</span></li>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/jingxuan1.jpg"><span>专业名称</span></li>
    </ul>
  </section>
  
  <section class="menu-right padding-all j-content" style="display:none">
    <h5><center>音乐部</center></h5>
    <ul>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/pro3.jpg"><span>专业名称</span></li>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/pro3.jpg"><span>专业名称</span></li>
      <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/pro3.jpg"><span>专业名称</span></li>
    </ul>
  </section> --%>
  <c:if test="${not empty emsDetpsList }">
  <c:forEach items="${emsDetpsList }" var="dept" varStatus="stat">
	  <section class="menu-right padding-all j-content" style="display:${stat.index eq 0?'block':'none'}">
	    <h5><center>${dept.name }</center></h5>
	    <ul>
	      <%-- <li class="w-3"><a href="pro_list.html"></a> <img src="${ctxStatic}/sdsng/upload/jingxuan1.jpg"><span>专业名称</span></li> --%>
	      <c:forEach items="${dept.majorList }" var="major">
	      		<li class="w-3"><a href="#" onclick="queryCourseList('${major.id}');"></a> <img src="${major.logo}"><span>${major.name }</span></li>
	      </c:forEach>
	    </ul>
	  </section>
  </c:forEach>
  </c:if>
   <c:if test="${empty emsDetpsList }">
   	<div style="margin-left: 100px;">区域${emsArea.name }下没有专业</div>
   	
  </c:if>
</div>
<script src="${ctxStatic}/sdsng/lib/jquery-2.1.4.js"></script> 
<script src="${ctxStatic}/sdsng/lib/fastclick.js"></script> 
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script>
<script src="${ctxStatic}/sdsng/js/jquery-weui.js"></script>
<script type="text/javascript">
	$(function($){
		$('#sidebar ul li').click(function(){
			$(this).addClass('active').siblings('li').removeClass('active');
			var index = $(this).index();
			$('.j-content').eq(index).show().siblings('.j-content').hide();
		})
	})
	
	function selectDept(obj)
	{
		var deptId = $(obj).attr("deptId");
		$("#deptId").val(deptId);
	}
	
	function selectMajor()
	{
		var term = $("#termId option:selected").val();
		var area = $("#areaId option:selected").val();
		
		location = ctx + "/toClassfy?siteId=${site.id}&emsTerm.id=" + term + "&emsArea.id=" + area;
	}
	
	function queryCourseList(majorId)
	{
		var termId = $("#termId option:selected").val();
		var deptId = $("#deptId").val();
		location = ctx + "/courseList?siteId=${site.id}&term.id=" + termId + "&major.id=" + majorId + "&major.dept.id=" + deptId;
	}
</script>
</body>
</html>